/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ghanaroutes.entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author User
 */
@Entity
@Table(name = "routeComments")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "RouteComments.findAll", query = "SELECT r FROM RouteComments r"),
    @NamedQuery(name = "RouteComments.findByCommentId", query = "SELECT r FROM RouteComments r WHERE r.commentId = :commentId"),
    @NamedQuery(name = "RouteComments.findByRouteType", query = "SELECT r FROM RouteComments r WHERE r.routeType = :routeType"),
    @NamedQuery(name = "RouteComments.findByUserId", query = "SELECT r FROM RouteComments r WHERE r.userId = :userId"),
    @NamedQuery(name = "RouteComments.findByRouteId", query = "SELECT r FROM RouteComments r WHERE r.routeId = :routeId"),
    @NamedQuery(name = "RouteComments.findByComment", query = "SELECT r FROM RouteComments r WHERE r.comment = :comment"),
    @NamedQuery(name = "RouteComments.findByDateCommented", query = "SELECT r FROM RouteComments r WHERE r.dateCommented = :dateCommented")})
public class RouteComments implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "commentId")
    private Integer commentId;
    @Column(name = "routeType")
    private Short routeType;
    @Column(name = "userId")
    private Integer userId;
    @Column(name = "routeId")
    private Integer routeId;
    @Size(max = 200)
    @Column(name = "comment")
    private String comment;
    @Column(name = "dateCommented")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateCommented;

    public RouteComments() {
    }

    public RouteComments(Integer commentId) {
        this.commentId = commentId;
    }

    public RouteComments(Integer commentId, Date dateCommented) {
        this.commentId = commentId;
        this.dateCommented = dateCommented;
    }

    public Integer getCommentId() {
        return commentId;
    }

    public void setCommentId(Integer commentId) {
        this.commentId = commentId;
    }

    public Short getRouteType() {
        return routeType;
    }

    public void setRouteType(Short routeType) {
        this.routeType = routeType;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getRouteId() {
        return routeId;
    }

    public void setRouteId(Integer routeId) {
        this.routeId = routeId;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public Date getDateCommented() {
        return dateCommented;
    }

    public void setDateCommented(Date dateCommented) {
        this.dateCommented = dateCommented;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (commentId != null ? commentId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RouteComments)) {
            return false;
        }
        RouteComments other = (RouteComments) object;
        if ((this.commentId == null && other.commentId != null) || (this.commentId != null && !this.commentId.equals(other.commentId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ghanaroutes.entities.RouteComments[ commentId=" + commentId + " ]";
    }
    
}
